package com.al.dao;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.al.db.DBHelper;

public class PageDao {
	DBHelper db = new DBHelper();
	public int findRecordCount() {
		//使用集合查询查到总记录数
		String sql = "select count(*) as countNum from users";
		ResultSet rs = null;
		int countNum = 0;
		try {
			rs = db.executeQuery(sql);
			while(rs.next()) {
				countNum = rs.getInt("countNum");
			}
		} catch (ClassNotFoundException | SQLException e) {
			e.printStackTrace();
		}
		System.out.println(countNum);
		return countNum;
	}

}
